import os
import re
import json
# from array import *

import MySQLdb
    
import A更新基金基础信息

fundList = {}

db = MySQLdb.connect("localhost", "jijin", "jijin", "jijin", charset='utf8' )


# 使用cursor()方法获取操作游标 
cursor = db.cursor()

# SQL 查询语句
sql = "SELECT fundId, fundName, type1 FROM fund WHERE fundName NOT LIKE '%后端%' AND birthday IS NULL"

try:
    # 执行SQL语句
    cursor.execute(sql)
    # 获取所有记录列表
    results = cursor.fetchall()
    for row in results:
        fundId = row[0]
        fundName = row[1]
        type1 = row[2]

        if fundName.find("(后端)") < 0:
            # 打印结果
            print ("fundId=%s,fundName=%s,type1=%s" % (fundId, fundName, type1))
            # fundList.add(fundId)
            A更新基金基础信息.baseMsg(fundId)
except Exception as ex:
    print("出现如下异常%s"%ex)

db.close()

# print(fundList)

print("程序运行结束")
